
	**APPENDIX
	
	
	
	*SECTION 1: SUMMARY TABLE
{	
	*Table A1-summary table
su lniMigrants PeriMigrantterror PeriMigrantterror PeriMigrantterhigh PeriMigrantsfriterateany PeriMigrantsdiff polity2 lnGTD lngdp lnpop  ///
civilwar internationalwar F.physint F.reversedPTS_A F.reversedPTS_S F.v2x_clphy F.theta_mean physint reversedPTS_A reversedPTS_S v2x_clphy theta_mean 
}
	*SECTION 2: Alternate Dependent Variables
{		
		*PTS-Amnesty scores, appendix Table 1

		*Baseline
			xtgee F.reversedPTS_A lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using mainDraftTable2,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtgee F.reversedPTS_A PeriMigrantterror lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using mainDraftTable2,  append word excel label 
		*Add in Percent from High-Terror Countries 
			xtgee F.reversedPTS_A PeriMigrantterhigh lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using mainDraftTable2,  append word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtgee F.reversedPTS_A PeriMigrantsfriterateany lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using mainDraftTable2,  append word excel label 
		*Add in Percent from different Russett civilization categories
			xtgee F.reversedPTS_A PeriMigrantsdiff lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using mainDraftTable2,  append word excel label 	
			*full model
		xtgee F.reversedPTS_A   PeriMigrantterror PeriMigrantterhigh PeriMigrantsfriterateany PeriMigrantsdiff  lniMigrants   polity2 ///
		lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
		 *outreg2 using mainDraftTable2,  append  word excel label 
				
		*PTS-State Department - appendix Table 2

		*Baseline
			xtgee F.reversedPTS_S lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980, corr(ar1) force  robust
			*outreg2 using DraftTable2,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtgee F.reversedPTS_S PeriMigrantterror lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980, corr(ar1) force  robust
			*outreg2 using DraftTable2,  append  word excel label 
		*Add in Percent from High-Terror Countries 
			xtgee F.reversedPTS_S PeriMigrantterhigh lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980, corr(ar1) force  robust
			*outreg2 using DraftTable2,  append  word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtgee F.reversedPTS_S PeriMigrantsfriterateany lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980, corr(ar1) force  robust
			*outreg2 using DraftTable2,  append  word excel label 
		*Add in Percent from different Russett civilization categories
			xtgee F.reversedPTS_S PeriMigrantsdiff lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980, corr(ar1) force  robust
			*outreg2 using DraftTable2,  append  word excel label 
		*full model
		xtgee F.reversedPTS_S   PeriMigrantterror PeriMigrantterhigh PeriMigrantsfriterateany PeriMigrantsdiff  lniMigrants   polity2 ///
		lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
		*outreg2 using DraftTable2,  append  word excel label 
		
		
		*VDem-Physical Violence Index - appendix Table 3

		*Baseline
			xtgee F.v2x_clphy  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
			*outreg2 using DraftTable3,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtgee F.v2x_clphy  PeriMigrantterror lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
			*outreg2 using DraftTable3,   append word excel label 
		*Add in Percent from High-Terror Countries 
			xtgee F.v2x_clphy  PeriMigrantterhigh lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
			*outreg2 using DraftTable3,  append  word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtgee F.v2x_clphy  PeriMigrantsfriterateany lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
			*outreg2 using DraftTable3,   append word excel label 
		*Add in Percent from different Russett civilization categories
			xtgee F.v2x_clphy  PeriMigrantsdiff lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
				*outreg2 using DraftTable3,   append  word excel label 
				*Full model
		xtgee F.v2x_clphy  PeriMigrantterror PeriMigrantterhigh PeriMigrantsfriterateany PeriMigrantsdiff  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
		*outreg2 using DraftTable3,  append  word excel label 
		
				
		*Fariss Latent Human Rights Mean - appendix, Table 4

		*Baseline
			xtgee F.theta_mean lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
			*outreg2 using DraftTable4,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtgee F.theta_mean  PeriMigrantterror lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
			*outreg2 using DraftTable4,   append word excel label 
		*Add in Percent from High-Terror Countries 
			xtgee F.theta_mean  PeriMigrantterhigh lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
			*outreg2 using DraftTable4,  append  word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtgee F.theta_mean PeriMigrantsfriterateany lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
			*outreg2 using DraftTable4,   append word excel label 
		*Add in Percent from different Russett civilization categories
			xtgee F.theta_mean PeriMigrantsdiff lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
				*outreg2 using DraftTable4,   append  word excel label 
			*full model
			xtgee F.theta_mean  PeriMigrantterror PeriMigrantterhigh PeriMigrantsfriterateany PeriMigrantsdiff  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
		*outreg2 using DraftTable4,  append  word excel label 

}
	*SECTION 3: IMPIC and DEMIG Control Models
{
		*IMPIC as control,  Table 5, Appendix
		*Baseline
			xtgee F.physint AvgS_ImmPol  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if oecd==1 , corr(ar1) force  robust
			*outreg2 using DraftTable5,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtgee F.physint AvgS_ImmPol  PeriMigrantterror lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if oecd==1 , corr(ar1) force  robust
			*outreg2 using DraftTable5,  append  word excel label 
		*Add in Percent from High-Terror Countries 
			xtgee F.physint  AvgS_ImmPol PeriMigrantterhigh lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if oecd==1 , corr(ar1) force  robust
			*outreg2 using DraftTable5,  append  word excel label 
		*Add in Percent from states whose natinals conducted at least one trans event 
			xtgee F.physint AvgS_ImmPol PeriMigrantsfriterateany  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if oecd==1 , corr(ar1) force  robust
			*outreg2 using  DraftTable5,  append  word excel label 
		*Add in Percent from different Russett civilization categories
			xtgee F.physint  AvgS_ImmPol PeriMigrantsdiff lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if oecd==1 , corr(ar1) force  robust
			*outreg2 using  DraftTable5,  append  word excel label 
         *Full model 
		xtgee F.physint AvgS_ImmPol PeriMigrantterror PeriMigrantterhigh PeriMigrantsfriterateany PeriMigrantsdiff lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if oecd==1 , corr(ar1) force  robust
                **outreg2 using  DraftTable5,  append  word excel label 

		*Demig as control,  Table 6, Appendix (OECD countries only)

		*Baseline
			xtgee F.physint  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar cum_morerestrictive  cum_lessrestrictive  i.year if oecd==1  , corr(ar1) force  robust
			*outreg2 using DraftTable6,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtgee F.physint  PeriMigrantterror lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar cum_morerestrictive  cum_lessrestrictive i.year if oecd==1 , corr(ar1) force  robust
			*outreg2 using DraftTable6,  append  word excel label 
		*Add in Percent from High-Terror Countries 
			xtgee F.physint  PeriMigrantterhigh lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar cum_morerestrictive  cum_lessrestrictive  i.year if oecd==1 , corr(ar1) force  robust
			*outreg2 using DraftTable6,  append  word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtgee F.physint PeriMigrantsfriterateany  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar cum_morerestrictive  cum_lessrestrictive i.year if oecd==1  , corr(ar1) force  robust
			*outreg2 using DraftTable6,  append  word excel label 
		*Add in Percent from different Russett civilization categories
			xtgee F.physint  PeriMigrantsdiff lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar cum_morerestrictive  cum_lessrestrictive  i.year if oecd==1 , corr(ar1) force  robust
			*outreg2 using DraftTable6,  append  word excel label 

	}		
	*SECTION 4: No Interpolation
	 {
		*without interpolate: Table 7, Appendix
		*Baseline
			xtgee F.physint  lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTable7,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtgee F.physint  PerMigrantterror lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTable7,  append word excel label 
		*Add in Percent from High-Terror Countries 
			xtgee F.physint  PerMigrantterhigh lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTable7,  append word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtgee F.physint PerMigrantsfriterateany  lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTable7,  append word excel label 
		*Add in Percent from different Russett civilization categories:
			xtgee F.physint  PerMigrantsdiff lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTable7,  append word excel label 
		*full model 
		xtgee F.physint   PeriMigrantterror PeriMigrantterhigh PeriMigrantsfriterateany PeriMigrantsdiff  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
		*outreg2 using DraftTable7,  replace  word excel label 
		
}	

	*SECTION 5: Interpolation
{
foreach x of newlist l c s n{
******Models in the Original Submission:
{
		**gen reversedPTS_A = 6-PTS_A
		**gen reversedPTS_S = 6-PTS_S

		*Physint 
		*Baseline
			xtgee F.physint  `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTable`x'1,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtgee F.physint  `x'PerMigrantterror `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTable`x'1,  append word excel label 
		*Add in Percent from High-Terror Countries 
			xtgee F.physint  `x'PerMigrantterhigh `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTable`x'1,  append word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtgee F.physint `x'PerMigrantsfriterateany  `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTable`x'1,  append word excel label 
		*Add in Percent from different Russett civilization categories:
			xtgee F.physint  `x'PerMigrantsdiff `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTable`x'1,  append word excel label 

			
		*PTS-A - appendix 

		*Baseline
			xtgee F.reversedPTS_A `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTable`x'2,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtgee F.reversedPTS_A `x'PerMigrantterror `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTable`x'2,  append word excel label 
		*Add in Percent from High-Terror Countries 
			xtgee F.reversedPTS_A `x'PerMigrantterhigh `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTable`x'2,  append word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtgee F.reversedPTS_A `x'PerMigrantsfriterateany `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTable`x'2,  append word excel label 
		*Add in Percent from different Russett civilization categories
			xtgee F.reversedPTS_A `x'PerMigrantsdiff `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTable`x'2,  append word excel label 	
				


		*PTS-S - appendix 

		*Baseline
			xtgee F.reversedPTS_S `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980, corr(ar1) force  robust
			*outreg2 using DraftTable`x'3,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtgee F.reversedPTS_S `x'PerMigrantterror `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980, corr(ar1) force  robust
			*outreg2 using DraftTable`x'3,  append  word excel label 
		*Add in Percent from High-Terror Countries 
			xtgee F.reversedPTS_S `x'PerMigrantterhigh `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980, corr(ar1) force  robust
			*outreg2 using DraftTable`x'3,  append  word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtgee F.reversedPTS_S `x'PerMigrantsfriterateany `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980, corr(ar1) force  robust
			*outreg2 using DraftTable`x'3,  append  word excel label 
		*Add in Percent from different Russett civilization categories
			xtgee F.reversedPTS_S `x'PerMigrantsdiff `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980, corr(ar1) force  robust
			*outreg2 using DraftTable`x'3,  append  word excel label 
				
			
		*VDem-Physical Violence Index - appendix 

		*Baseline
			xtgee F.v2x_clphy  `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
			*outreg2 using DraftTable`x'4,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtgee F.v2x_clphy  `x'PerMigrantterror `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
			*outreg2 using DraftTable`x'4,   append word excel label 
		*Add in Percent from High-Terror Countries 
			xtgee F.v2x_clphy  `x'PerMigrantterhigh `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
			*outreg2 using DraftTable`x'4,  append  word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtgee F.v2x_clphy  `x'PerMigrantsfriterateany `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
			*outreg2 using DraftTable`x'4,   append word excel label 
		*Add in Percent from different Russett civilization categories
			xtgee F.v2x_clphy  `x'PerMigrantsdiff `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
				*outreg2 using DraftTable`x'4,   append  word excel label 
			
				
		*Fariss Latent Human Rights Mean - appendix 

		*Baseline
			xtgee F.theta_mean `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
			*outreg2 using DraftTable`x'5,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtgee F.theta_mean  `x'PerMigrantterror `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
			*outreg2 using DraftTable`x'5,   append word excel label 
		*Add in Percent from High-Terror Countries 
			xtgee F.theta_mean  `x'PerMigrantterhigh `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
			*outreg2 using DraftTable`x'5,  append  word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtgee F.theta_mean `x'PerMigrantsfriterateany `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
			*outreg2 using DraftTable`x'5,   append word excel label 
		*Add in Percent from different Russett civilization categories
			xtgee F.theta_mean `x'PerMigrantsdiff `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
				*outreg2 using DraftTable`x'5,   append  word excel label 
			

		*IMPIC

		*Baseline
			xtgee F.physint AvgS_ImmPol  `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if oecd==1 , corr(ar1) force  robust
			*outreg2 using DraftTable`x'6,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtgee F.physint AvgS_ImmPol  `x'PerMigrantterror `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if oecd==1 , corr(ar1) force  robust
			*outreg2 using DraftTable`x'6,  append  word excel label 
		*Add in Percent from High-Terror Countries 
			xtgee F.physint  AvgS_ImmPol `x'PerMigrantterhigh `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if oecd==1 , corr(ar1) force  robust
			*outreg2 using DraftTable`x'6,  append  word excel label 
		*Add in Percent from states whose natinals conducted at least one trans event 
			xtgee F.physint AvgS_ImmPol `x'PerMigrantsfriterateany  `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if oecd==1 , corr(ar1) force  robust
			*outreg2 using  DraftTable`x'6,  append  word excel label 
		*Add in Percent from different Russett civilization categories
			xtgee F.physint  AvgS_ImmPol `x'PerMigrantsdiff `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if oecd==1 , corr(ar1) force  robust
			*outreg2 using  DraftTable`x'6,  append  word excel label 


		*Demig

		*Baseline
			xtgee F.physint  `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar cum_morerestrictive  cum_lessrestrictive  i.year if oecd==1  , corr(ar1) force  robust
			*outreg2 using DraftTable`x'7,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtgee F.physint  `x'PerMigrantterror `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar cum_morerestrictive  cum_lessrestrictive i.year if oecd==1 , corr(ar1) force  robust
			*outreg2 using DraftTable`x'7,  append  word excel label 
		*Add in Percent from High-Terror Countries 
			xtgee F.physint  `x'PerMigrantterhigh `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar cum_morerestrictive  cum_lessrestrictive  i.year if oecd==1 , corr(ar1) force  robust
			*outreg2 using DraftTable`x'7,  append  word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtgee F.physint `x'PerMigrantsfriterateany  `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar cum_morerestrictive  cum_lessrestrictive i.year if oecd==1  , corr(ar1) force  robust
			*outreg2 using DraftTable`x'7,  append  word excel label 
		*Add in Percent from different Russett civilization categories
			xtgee F.physint  `x'PerMigrantsdiff `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar cum_morerestrictive  cum_lessrestrictive  i.year if oecd==1 , corr(ar1) force  robust
			*outreg2 using DraftTable`x'7,  append  word excel label 

		*without interpolate:
		*Baseline
			xtgee F.physint  lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTable`x'8,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtgee F.physint  PerMigrantterror lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTable`x'8,  append word excel label 
		*Add in Percent from High-Terror Countries 
			xtgee F.physint  PerMigrantterhigh lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTable`x'8,  append word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtgee F.physint PerMigrantsfriterateany  lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTable`x'8,  append word excel label 
		*Add in Percent from different Russett civilization categories:
			xtgee F.physint  PerMigrantsdiff lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTable`x'8,  append word excel label 

		*Figure 1
		xtgee F.physint  `x'PerMigrantterror `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
		margins, atmeans at(`x'PerMigrantterror=(0(5)100)) vsquish
		marginsplot, recast(line) recastci(rarea) addplot(hist `x'PerMigrantterror if e(sample), fraction  yaxis(2))


		*Figure 2
		xtgee F.physint  `x'PerMigrantterhigh `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
		margins, atmeans at(`x'PerMigrantterhigh=(0(5)100)) vsquish
		marginsplot, recast(line) recastci(rarea) addplot(hist `x'PerMigrantterhigh if e(sample), fraction  yaxis(2))


		*Figure 3
		xtgee F.physint  `x'PerMigrantsfriterateany `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
		margins, atmeans at(`x'PerMigrantsfriterateany=(0(5)100)) vsquish
		marginsplot, recast(line) recastci(rarea) addplot(hist `x'PerMigrantsfriterateany if e(sample), fraction  yaxis(2))

		*table to add in column on all variables in one model for each table 
		xtgee F.physint   `x'PerMigrantterror `x'PerMigrantterhigh `x'PerMigrantsfriterateany `x'PerMigrantsdiff  `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
		*outreg2 using DraftTable`x'9,  replace  word excel label 
		xtgee F.reversedPTS_A   `x'PerMigrantterror `x'PerMigrantterhigh `x'PerMigrantsfriterateany `x'PerMigrantsdiff  `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
		*outreg2 using DraftTable`x'9,  append  word excel label 
		xtgee F.reversedPTS_S   `x'PerMigrantterror `x'PerMigrantterhigh `x'PerMigrantsfriterateany `x'PerMigrantsdiff  `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
		*outreg2 using DraftTable`x'9,  append  word excel label 
		xtgee F.v2x_clphy  `x'PerMigrantterror `x'PerMigrantterhigh `x'PerMigrantsfriterateany `x'PerMigrantsdiff  `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
		*outreg2 using DraftTable`x'9,  append  word excel label 
		xtgee F.theta_mean  `x'PerMigrantterror `x'PerMigrantterhigh `x'PerMigrantsfriterateany `x'PerMigrantsdiff  `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if year>=1980 , corr(ar1) force  robust
		*outreg2 using DraftTable`x'9,  append  word excel label 

		*new table to add column on all variables in one model
		xtgee F.physint AvgS_ImmPol `x'PerMigrantterror `x'PerMigrantterhigh `x'PerMigrantsfriterateany `x'PerMigrantsdiff `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year if oecd==1 , corr(ar1) force  robust
		*outreg2 using DraftTable`x'10,  replace  word excel label 
		xtgee F.physint `x'PerMigrantterror `x'PerMigrantterhigh `x'PerMigrantsfriterateany `x'PerMigrantsdiff `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar cum_morerestrictive  cum_lessrestrictive  i.year if oecd==1  , corr(ar1) force  robust
		*outreg2 using DraftTable`x'10,  append  word excel label 
		xtgee F.physint  PerMigrantterror PerMigrantterhigh PerMigrantsfriterateany PerMigrantsdiff lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
		*outreg2 using DraftTable`x'11,  replace  word excel label 


		
 }
 }
 }
 
	*SECTION 6: Altenative Codings of Key Variables
  {
foreach x of newlist l c s n{
xtgee F.physint  `x'PerMigrantterror5  `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenew`x'1,  replace word excel label 
xtgee F.physint  `x'PerMigrantterhigh2  `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenew`x'1,  append word excel label 
xtgee F.physint  `x'PerMigrantterrorhighest `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenew`x'1,  append word excel label 
xtgee F.physint  `x'PerMigrantterrorint `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenew`x'1,  append word excel label 
xtgee F.physint  `x'PerMigrantterorint5 `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenew`x'1,  append word excel label 
xtgee F.physint  `x'PerMigrantterrorinthigh `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenew`x'1,  append word excel label 
xtgee F.physint  `x'PerMigrantterrorinthighest `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenew`x'1,  append word excel label 
xtgee F.physint  `x'PerMigrantterrordom `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenew`x'1,  append word excel label 
xtgee F.physint  `x'PerMigrantterrordom5  `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenew`x'1,  append word excel label 
xtgee F.physint  `x'PerMigrantterrordomhigh  `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenew`x'1,  append word excel label 
xtgee F.physint  `x'PerMigrantterrordomhighest   `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenew`x'1,  append word excel label 
xtgee F.physint  `x'PerMigrantterroriter     `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenew`x'1,  append word excel label 
xtgee F.physint  `x'PerMigrantterroriter2    `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenew`x'1,  append word excel label 
xtgee F.physint  `x'PerMigrantterrorfatal    `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenew`x'1,  append word excel label 
xtgee F.physint  `x'PerMigrantterrorfatalhigh    `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenew`x'1,  append word excel label 
xtgee F.physint  `x'PerMigrantsfriterate2    `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenew`x'1,  append word excel label 
xtgee F.physint  `x'PerMigrantsfriterate4   `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenew`x'1,  append word excel label 
xtgee F.physint  `x'PerMigrantsfriterate16   `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenew`x'1,  append word excel label 
xtgee F.physint  `x'PerMigrantterroriter3   `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenew`x'1,  append word excel label 
xtgee F.physint  `x'PerMigrantterroriterhigh `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenew`x'1,  append word excel label 
xtgee F.physint  `x'PerMigrantterroriterhighest  `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenew`x'1,  append word excel label 
}
}

	*SECTION 7: Fixed Effects
  {
**FIXED EFFECTS MODELS

*Fixed Effects on country and year:
 
	*Fixed Effects Models - Physint
		{
		 
	
		 
		*We can go back and just run a fixed effects model (due to Nickel bias, we don't add a lagged dvar and can't address autocorrelation
		 *Baseline
			xtreg F.physint  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year, fe  robust
			*outreg2 using DraftTableRR2,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtreg  F.physint  PeriMigrantterror lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  , fe robust
			*outreg2 using DraftTableRR2,  append word excel label 
		*Add in Percent from High-Terror Countries 
			xtreg  F.physint  PeriMigrantterhigh lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  ,  fe robust
			*outreg2 using DraftTableRR2,  append word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtreg F.physint PeriMigrantsfriterateany  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , fe robust
			*outreg2 using DraftTableRR2,  append word excel label 
		*Add in Percent from different Russett civilization categories:
			xtreg  F.physint  PeriMigrantsdiff lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  , fe  robust
			*outreg2 using DraftTableRR2,  append word excel label 
		*All key indicators together
			xtreg  F.physint   PeriMigrantterror PeriMigrantterhigh PeriMigrantsfriterateany PeriMigrantsdiff  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year, fe robust
			*outreg2 using DraftTableRR2,  append word excel label 

		*Fixed Effects (ccode and year) with a state-specific time trend
			 *Baseline
			xtreg F.physint  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year c.year##i.ccode, fe  robust
			*outreg2 using DraftTableRR3,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtreg  F.physint  PeriMigrantterror lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  c.year##i.ccode,  fe robust
			*outreg2 using DraftTableRR3,  append word excel label 
		*Add in Percent from High-Terror Countries 
			xtreg  F.physint  PeriMigrantterhigh lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  c.year##i.ccode,   fe robust
			*outreg2 using DraftTableRR3,  append word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtreg F.physint PeriMigrantsfriterateany  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  c.year##i.ccode, fe robust
			*outreg2 using DraftTableRR3,  append word excel label 
		*Add in Percent from different Russett civilization categories:
			xtreg  F.physint  PeriMigrantsdiff lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  c.year##i.ccode,  fe  robust
			*outreg2 using DraftTableRR3,  append word excel label 
		*All key indicators together
			xtreg  F.physint   PeriMigrantterror PeriMigrantterhigh PeriMigrantsfriterateany PeriMigrantsdiff  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  c.year##i.ccode,  fe robust
			*outreg2 using DraftTableRR3,  append word excel label 
}
	*Fixed Effects Models - Amnesty
		{
		 
		*We can go back and just run a fixed effects model (due to Nickel bias, we don't add a lagged dvar and can't address autocorrelation
		 *Baseline
			xtreg F.reversedPTS_A  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year, fe  robust
			*outreg2 using DraftTableRR5,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtreg  F.reversedPTS_A  PeriMigrantterror lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  , fe robust
			*outreg2 using DraftTableRR5,  append word excel label 
		*Add in Percent from High-Terror Countries 
			xtreg  F.reversedPTS_A  PeriMigrantterhigh lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  ,  fe robust
			*outreg2 using DraftTableRR5,  append word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtreg F.reversedPTS_A PeriMigrantsfriterateany  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , fe robust
			*outreg2 using DraftTableRR5,  append word excel label 
		*Add in Percent from different Russett civilization categories:
			xtreg  F.reversedPTS_A  PeriMigrantsdiff lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  , fe  robust
			*outreg2 using DraftTableRR5,  append word excel label 
		*All key indicators together
			xtreg  F.reversedPTS_A   PeriMigrantterror PeriMigrantterhigh PeriMigrantsfriterateany PeriMigrantsdiff  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year, fe robust
			*outreg2 using DraftTableRR5,  append word excel label 

		*Fixed Effects (ccode and year) with a state-specific time trend
			 *Baseline
			xtreg F.reversedPTS_A  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year c.year##i.ccode, fe  robust
			*outreg2 using DraftTableRR6,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtreg  F.reversedPTS_A  PeriMigrantterror lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  c.year##i.ccode,  fe robust
			*outreg2 using DraftTableRR6,  append word excel label 
		*Add in Percent from High-Terror Countries 
			xtreg  F.reversedPTS_A  PeriMigrantterhigh lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  c.year##i.ccode,   fe robust
			*outreg2 using DraftTableRR6,  append word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtreg F.reversedPTS_A PeriMigrantsfriterateany  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  c.year##i.ccode, fe robust
			*outreg2 using DraftTableRR6,  append word excel label 
		*Add in Percent from different Russett civilization categories:
			xtreg  F.reversedPTS_A  PeriMigrantsdiff lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  c.year##i.ccode,  fe  robust
			*outreg2 using DraftTableRR6,  append word excel label 
		*All key indicators together
			xtreg  F.reversedPTS_A   PeriMigrantterror PeriMigrantterhigh PeriMigrantsfriterateany PeriMigrantsdiff  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  c.year##i.ccode,  fe robust
			*outreg2 using DraftTableRR6,  append word excel label 

 }
	*Fixed Effects Models -  State Department 
		{
				
		*We can go back and just run a fixed effects model (due to Nickel bias, we don't add a lagged dvar and can't address autocorrelation
		 *Baseline
			xtreg F.reversedPTS_S  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year, fe  robust
			*outreg2 using DraftTableRR8,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtreg  F.reversedPTS_S  PeriMigrantterror lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  , fe robust
			*outreg2 using DraftTableRR8,  append word excel label 
		*Add in Percent from High-Terror Countries 
			xtreg  F.reversedPTS_S  PeriMigrantterhigh lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  ,  fe robust
			*outreg2 using DraftTableRR8,  append word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtreg F.reversedPTS_S PeriMigrantsfriterateany  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , fe robust
			*outreg2 using DraftTableRR8,  append word excel label 
		*Add in Percent from different Russett civilization categories:
			xtreg  F.reversedPTS_S  PeriMigrantsdiff lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  , fe  robust
			*outreg2 using DraftTableRR8,  append word excel label 
		*All key indicators together
			xtreg  F.reversedPTS_S   PeriMigrantterror PeriMigrantterhigh PeriMigrantsfriterateany PeriMigrantsdiff  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year, fe robust
			*outreg2 using DraftTableRR8,  append word excel label 

		*Fixed Effects (ccode and year) with a state-specific time trend
			 *Baseline
			xtreg F.reversedPTS_S  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year c.year##i.ccode, fe  robust
			*outreg2 using DraftTableRR9,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtreg  F.reversedPTS_S  PeriMigrantterror lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  c.year##i.ccode,  fe robust
			*outreg2 using DraftTableRR9,  append word excel label 
		*Add in Percent from High-Terror Countries 
			xtreg  F.reversedPTS_S  PeriMigrantterhigh lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  c.year##i.ccode,   fe robust
			*outreg2 using DraftTableRR9,  append word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtreg F.reversedPTS_S PeriMigrantsfriterateany  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  c.year##i.ccode, fe robust
			*outreg2 using DraftTableRR9,  append word excel label 
		*Add in Percent from different Russett civilization categories:
			xtreg  F.reversedPTS_S  PeriMigrantsdiff lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  c.year##i.ccode,  fe  robust
			*outreg2 using DraftTableRR9,  append word excel label 
		*All key indicators together
			xtreg  F.reversedPTS_S   PeriMigrantterror PeriMigrantterhigh PeriMigrantsfriterateany PeriMigrantsdiff  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  c.year##i.ccode,  fe robust
			*outreg2 using DraftTableRR9,  append word excel label 

		 }
	*Fixed Effects - Fariss 
		{

		*We can also go back and just run a fixed effects model (due to Nickel bias, we don't add a lagged dvar and can't address autocorrelation
		 *Baseline
			xtreg F.theta_mean  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year, fe  robust
			*outreg2 using DraftTableRR11,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtreg  F.theta_mean  PeriMigrantterror lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  , fe robust
			*outreg2 using DraftTableRR11,  append word excel label 
		*Add in Percent from High-Terror Countries 
			xtreg  F.theta_mean  PeriMigrantterhigh lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  ,  fe robust
			*outreg2 using DraftTableRR11,  append word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtreg F.theta_mean PeriMigrantsfriterateany  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , fe robust
			*outreg2 using DraftTableRR11,  append word excel label 
		*Add in Percent from different Russett civilization categories:
			xtreg  F.theta_mean  PeriMigrantsdiff lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  , fe  robust
			*outreg2 using DraftTableRR11,  append word excel label 
		*All key indicators together
			xtreg  F.theta_mean   PeriMigrantterror PeriMigrantterhigh PeriMigrantsfriterateany PeriMigrantsdiff  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year, fe robust
			*outreg2 using DraftTableRR11,  append word excel label 

		*Fixed Effects (ccode and year) with a state-specific time trend
			 *Baseline
			xtreg F.theta_mean  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year c.year##i.ccode, fe  robust
			*outreg2 using DraftTableRR12,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtreg  F.theta_mean  PeriMigrantterror lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  c.year##i.ccode,  fe robust
			*outreg2 using DraftTableRR12,  append word excel label 
		*Add in Percent from High-Terror Countries 
			xtreg  F.theta_mean  PeriMigrantterhigh lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  c.year##i.ccode,   fe robust
			*outreg2 using DraftTableRR12,  append word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtreg F.theta_mean PeriMigrantsfriterateany  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  c.year##i.ccode, fe robust
			*outreg2 using DraftTableRR12,  append word excel label 
		*Add in Percent from different Russett civilization categories:
			xtreg  F.theta_mean  PeriMigrantsdiff lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  c.year##i.ccode,  fe  robust
			*outreg2 using DraftTableRR12,  append word excel label 
		*All key indicators together
			xtreg  F.theta_mean   PeriMigrantterror PeriMigrantterhigh PeriMigrantsfriterateany PeriMigrantsdiff  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year  c.year##i.ccode,  fe robust
			*outreg2 using DraftTableRR12,  append word excel label 
}
}

   *SECTION 8 : Additional Controls
{
				
***Adding in new variables 

*LOWESS POLITY MODEL-TABLE 18
		*Baseline
			xtgee F.physint  llnMigrants   wdi_gdpgr  i.politypositive v2csreprss AntiGovernmentDemonstrations i.e_dpi_erlc   lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTableRRnewvariables,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtgee F.physint  lPerMigrantterror llnMigrants   wdi_gdpgr  i.politypositive v2csreprss AntiGovernmentDemonstrations i.e_dpi_erlc  lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTableRRnewvariables,  append  word excel label 
		*Add in Percent from High-Terror Countries 
			xtgee F.physint  lPerMigrantterhigh llnMigrants   wdi_gdpgr  i.politypositive v2csreprss AntiGovernmentDemonstrations i.e_dpi_erlc lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTableRRnewvariables,  append  word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtgee F.physint lPerMigrantsfriterateany  llnMigrants    wdi_gdpgr  i.politypositive v2csreprss AntiGovernmentDemonstrations i.e_dpi_erlc  lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTableRRnewvariables,  append  word excel label 
		*Add in Percent from different Russett civilization categories:
			xtgee F.physint  lPerMigrantsdiff llnMigrants   wdi_gdpgr  i.politypositive v2csreprss AntiGovernmentDemonstrations i.e_dpi_erlc  lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTableRRnewvariables,  append  word excel label 
		*All together
			xtgee F.physint   lPerMigrantterror lPerMigrantterhigh lPerMigrantsfriterateany lPerMigrantsdiff  llnMigrants    wdi_gdpgr  i.politypositive v2csreprss AntiGovernmentDemonstrations i.e_dpi_erlc lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTableRRnewvariables,  append  word excel label 

*Polity squared instead -APPENDIX, TABLE 19-POLITY SQUARED
*Baseline
			xtgee F.physint  llnMigrants   wdi_gdpgr  c.polity2##c.polity2 v2csreprss AntiGovernmentDemonstrations i.e_dpi_erlc   lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTableRRnewvariables2,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtgee F.physint  lPerMigrantterror llnMigrants   wdi_gdpgr  c.polity2##c.polity2 v2csreprss AntiGovernmentDemonstrations i.e_dpi_erlc  lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTableRRnewvariables2,  append  word excel label 
		*Add in Percent from High-Terror Countries 
			xtgee F.physint  lPerMigrantterhigh llnMigrants   wdi_gdpgr  c.polity2##c.polity2 v2csreprss AntiGovernmentDemonstrations i.e_dpi_erlc lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTableRRnewvariables2,  append  word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtgee F.physint lPerMigrantsfriterateany  llnMigrants    wdi_gdpgr  c.polity2##c.polity2 v2csreprss AntiGovernmentDemonstrations i.e_dpi_erlc  lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTableRRnewvariables2,  append  word excel label 
		*Add in Percent from different Russett civilization categories:
			xtgee F.physint  lPerMigrantsdiff llnMigrants   wdi_gdpgr  c.polity2##c.polity2 v2csreprss AntiGovernmentDemonstrations i.e_dpi_erlc  lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTableRRnewvariables2,  append  word excel label 
		*All together
			xtgee F.physint   lPerMigrantterror lPerMigrantterhigh lPerMigrantsfriterateany lPerMigrantsdiff  llnMigrants    wdi_gdpgr  c.polity2##c.polity2  v2csreprss AntiGovernmentDemonstrations i.e_dpi_erlc lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTableRRnewvariables2,  append  word excel label 

*WVS People can be trusted-APPENDIX TABLE 20
		reg  F.physint llnMigrants   wvs_trust lnGTD lngdp lnpop  civilwar internationalwar , robust cluster(ccode)
		*outreg2 using DraftTableRRnewvariables3,  replace  word excel label 
		reg  F.physint lPerMigrantterror llnMigrants   wvs_trust lnGTD lngdp lnpop  civilwar internationalwar , robust cluster(ccode)
		*outreg2 using DraftTableRRnewvariables3,  append  word excel label 
		reg  F.physint lPerMigrantterhigh   llnMigrants   wvs_trust lnGTD lngdp lnpop  civilwar internationalwar , robust cluster(ccode)
		*outreg2 using DraftTableRRnewvariables3,  append   word excel label 
		reg  F.physint lPerMigrantsfriterateany llnMigrants   wvs_trust lnGTD lngdp lnpop  civilwar internationalwar , robust cluster(ccode)
		*outreg2 using DraftTableRRnewvariables3,  append   word excel label 
		reg  F.physint lPerMigrantsdiff llnMigrants   wvs_trust lnGTD lngdp lnpop  civilwar internationalwar , robust cluster(ccode)
		*outreg2 using DraftTableRRnewvariables3,  append  word excel label 
		reg  F.physint  lPerMigrantterror lPerMigrantterhigh lPerMigrantsfriterateany lPerMigrantsdiff llnMigrants   wvs_trust lnGTD lngdp lnpop  civilwar internationalwar , robust cluster(ccode)
		*outreg2 using DraftTableRRnewvariables3,  append    word excel label 

**Table 21, distance and EPR added in
			xtgee F.physint ethnicgrpsyear mindistance  llnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTableEPR1,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtgee F.physint ethnicgrpsyear mindistance lPerMigrantterror llnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTableEPR1,  append word excel label 
			
		*Add in Percent from High-Terror Countries 
			xtgee F.physint ethnicgrpsyear mindistance lPerMigrantterhigh llnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTableEPR1,  append word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtgee F.physint ethnicgrpsyear mindistance lPerMigrantsfriterateany  llnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTableEPR1,  append word excel label 
		*Add in Percent from different Russett civilization categories:
			xtgee F.physint ethnicgrpsyear mindistance lPerMigrantsdiff llnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTableEPR1,  append word excel label
		*All key variables together
			xtgee F.physint ethnicgrpsyear mindistance  lPerMigrantterror lPerMigrantterhigh lPerMigrantsfriterateany lPerMigrantsdiff  llnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
			*outreg2 using DraftTableEPR1,  append  word excel label 
			
			
			
					
	
	*Tables 22-26
	
	*Multiple imputation 


foreach x of newlist l c s n{
xtgee F.physint  `x'PerMigrantsMAR1  `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenewMAR`x'1,  replace word excel label 
xtgee F.physint  `x'PerMigrantsMAR4  `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenewMAR`x'1,  append word excel label 
xtgee F.physint  `x'PerMigrantsGPROhigh `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenewMAR`x'1,  append word excel label 
xtgee F.physint  `x'PerMigrantsGPROhighest `x'lnMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(ar1) force  robust
*outreg2 using DraftTablenewMAR`x'1,  append word excel label 

}
}

	*SECTION 9: State Dependent models 
	{
**STATE DEPENDENT MODELS

*Interaction with past abuses 
{
*TABLE 27
******Models in the Original Submission:
{
		**gen reversedPTS_A = 6-PTS_A
		**gen reversedPTS_S = 6-PTS_S
		
		**generate reversedphysint = 8-physint

		*Physint 
		*Baseline
			xtgee F.physint  c.lniMigrants##c.reversedphysint   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(exc) force  robust
			*outreg2 using DraftTablesecondround,  replace  word excel label 
		*Add in Percent from countries with at least one terrorist attack 
			xtgee F.physint  c.PeriMigrantterror##c.reversedphysint  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(exc) force  robust
			*outreg2 using DraftTablesecondround,   append word excel label 
		*Add in Percent from High-Terror Countries 
			xtgee F.physint  c.PeriMigrantterhigh##c.reversedphysint  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(exc) force  robust
			*outreg2 using DraftTablesecondround,   append word excel label 
		*Add in Percent from states whose nationals conducted at least one trans event 
			xtgee F.physint c.PeriMigrantsfriterateany##c.reversedphysint   lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(exc) force  robust
			*outreg2 using DraftTablesecondround,   append word excel label 
		*Add in Percent from different Russett civilization categories:
			xtgee F.physint  c.PeriMigrantsdiff##c.reversedphysint  lniMigrants   polity2 lnGTD lngdp lnpop  civilwar internationalwar i.year , corr(exc) force  robust
			*outreg2 using DraftTablesecondround,  append word excel label 

	}
	
	
}
}

